Skip to content

Align upload limits with new MEDIA_MAX_UPLOAD_SIZE_MB app cap#38

Merged
turegjorup merged 2 commits into
release/3.0.0from
feature/media-upload-size-alignment
May 29, 2026
Merged

Align upload limits with new MEDIA_MAX_UPLOAD_SIZE_MB app cap#38
turegjorup merged 2 commits into
release/3.0.0from
feature/media-upload-size-alignment

Conversation

@turegjorup

Copy link
Copy Markdown
Contributor

Summary

Upstream PR os2display/display-api-service#458
(merged into upstream release/3.0.0 on 2026-05-26, issue
#392) introduced a new
Symfony-level upload ceiling: MEDIA_MAX_UPLOAD_SIZE_MB
(default 200 MiB), enforced by MediaFileValidator on Media::$file.

The cap flows into .env.symfony automatically via task env:init (which extracts the
upstream /app/.env), but the PHP and nginx example defaults shipped here (128M /
140M / 140m) were below it — large uploads would have been rejected at the proxy /
PHP layer with an opaque 413 instead of the app's clear validator error message.

  • Bump .env.php.example: PHP_UPLOAD_MAX_FILESIZE 128M → 200M, PHP_POST_MAX_SIZE 140M → 210M.
  • Bump .env.nginx.example: NGINX_MAX_BODY_SIZE 140m → 210m.
  • Comments in both files now reference the upstream MEDIA_MAX_UPLOAD_SIZE_MB ceiling.
  • New UPGRADE.md sub-section under §5 "Rewrite env config" spells out the four-layer
    inequality (NGINX_MAX_BODY_SIZE >= PHP_POST_MAX_SIZE >= PHP_UPLOAD_MAX_FILESIZE >= MEDIA_MAX_UPLOAD_SIZE_MB)
    and gives operators an env:diff step to catch a migrated .env.symfony that predates the new var.
  • CHANGELOG entry under Operations.

Test plan

  • Fresh install: task env:init on this branch writes PHP_UPLOAD_MAX_FILESIZE=200M, PHP_POST_MAX_SIZE=210M, NGINX_MAX_BODY_SIZE=210m into the per-service env files.
  • Stack comes up: task install succeeds, all services healthy.
  • App-level cap is the binding constraint: upload a ~150 MiB file in the admin UI → succeeds (well below app's 200 MiB cap, but above the old 128M PHP limit, proving the old limit would have rejected it).
  • App-level cap rejects clearly: upload a >200 MiB file → Symfony validator error referencing MEDIA_MAX_UPLOAD_SIZE_MB, not a generic 413.
  • task env:diff against the upstream image produces no spurious diff on the upload-related keys.
  • UPGRADE.md §5 renders correctly — the new sub-section lands before §6 "MariaDB 10.x → 11.4 upgrade".

🤖 Generated with Claude Code

turegjorup and others added 2 commits May 28, 2026 12:56
Upstream display-api-service 3.0.0 introduces a Symfony-level upload ceiling
(MEDIA_MAX_UPLOAD_SIZE_MB, default 200 MiB) enforced on Media::$file. The cap
flows into .env.symfony automatically via task env:init, but the PHP and nginx
example defaults shipped here (128M / 140M / 140m) were below it — large
uploads would have been rejected at the proxy/PHP layer with an opaque 413
instead of the app's clear validator error.

Bumps PHP_UPLOAD_MAX_FILESIZE to 200M, PHP_POST_MAX_SIZE to 210M, and
NGINX_MAX_BODY_SIZE to 210m so the four-layer inequality holds out of the box.
UPGRADE.md gets a new sub-section spelling out the alignment rule and an
env:diff verification step for operators whose migrated .env.symfony predates
the new var.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@turegjorup
turegjorup merged commit 8935030 into release/3.0.0 May 29, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant